package com.password.util;

public class ManagerExceptionUtil {

	/**
	 * 用户已存在的状态
	 */
	public final static Status userExistsStatus = Status.BuildExceptionStatus("400", "用户已存在");
	/**
	 * 用户不存在的状态
	 */
	public final static Status userNotExistsStatus = Status.BuildExceptionStatus("400", "用户不存在");
	/**
	 * 用户名或密码错误
	 */
	public final static Status userOrPasswordErrorStatus = Status.BuildExceptionStatus("400", "用户名或密码错误");
	/**
	 * 用户名不能为空
	 */
	public final static Status userNameEmptyStatus = Status.BuildExceptionStatus("400", "用户名不能为空");
	/**
	 * 密码不能为空
	 */
	public final static Status passwordEmptyStatus = Status.BuildExceptionStatus("400", "密码不能为空");

	/**
	 * 没有数据可读的异常，通常用于文件加密的过程中，提供的加密流为空
	 */
	public final static Status noAvailableDataReadStatus = Status.BuildExceptionStatus("400", "数据不可用");

	/**
	 * 加密文件格式错误
	 */
	public final static Status encrptyFileFormatStatus = Status.BuildExceptionStatus("400", "加密文件格式错误");
	/**
	 * mask校验错误
	 */
	public final static Status maskVerifyErrorStatus = Status.BuildExceptionStatus("400", "加密文件掩码校验失败");
	/**
	 * 加密模式异常
	 */
	public final static Status noSuchEncrptyModelStatus = Status.BuildExceptionStatus("400", "加密模式错误");
	/**
	 * 数据被破坏异常
	 */
	public final static Status dataErrorStatus = Status.BuildExceptionStatus("400", "文件已损坏");

	public static class Status {
		String code;
		String msg;

		public static Status BuildExceptionStatus(String code, String msg) {
			Status s = new Status();
			s.code = code;
			s.msg = msg;
			return s;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getMsg() {
			return msg;
		}

		public void setMsg(String msg) {
			this.msg = msg;
		}

	}

}
